public class Exer3_8_4 {
    public static void main(String[] args) {
        int i=1,sum=0;
        while(i<=1000){
            sum+=i;
            i++;
        }
        System.out.println("1到1000内所有数字的和为："+sum);
    }
}
